package com.welica.wat;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.welica.wat.config.RedisLockConfig;
import com.welica.wat.impl.RedisLock;
import com.welica.wat.stragety.DistributeLockStrategy;

@Configuration
@ConditionalOnProperty(value = "distributed.lock.redis.enable", havingValue = "true")
public class DistributedLockConfiguration {

	@Bean(name = "distributeRedisLock")
	public RedisLock distributeLock(RedisLockConfig redisLockConfig) {
		return new RedisLock(redisLockConfig);
	}

}
